﻿<phone:PhoneApplicationPage 
    xmlns:local="clr-namespace:RGBFinder"
    local:TiltEffect.IsTiltEnabled="True"
    x:Class="RGBFinder.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:mmi="clr-namespace:mmiWP7SDK;assembly=WP7SDK"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    SupportedOrientations="Portrait" Orientation="Portrait" 
    shell:SystemTray.IsVisible="True"
    Loaded="PhoneApplicationPage_Loaded" xmlns:my="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI">
<!--xmlns:toolbox="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"-->

    <Grid x:Name="LayoutRoot" Background="Transparent" Height="762">

        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="80" />
        </Grid.RowDefinitions>
        <!--Pivot Control-->
        <controls:Pivot Title="{Binding Path=Strings.Title, Source={StaticResource LocalizedStrings }}" Name="PivotControl" IsHitTestVisible="True" SelectionChanged="PivotControl_SelectionChanged" SelectedIndex="0" Margin="0,0,0,4">

            <controls:PivotItem Name="PlayPivot_Name" Header="{Binding Path=Strings.Play, Source={StaticResource LocalizedStrings }}" >
                <Grid Height="520">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="540*" />
                    </Grid.RowDefinitions>
                                        
                    <ListBox x:Name="GameType_List" Margin="2,4,4,0" ItemsSource="{Binding Ads}" SelectionChanged="GameType_List_SelectionChanged" SelectionMode="Single" Width="450">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Margin="0,0,0,17">
                                    <TextBlock Text="{Binding Name}" TextWrapping="NoWrap" Margin="12,0,0,0" Style="{StaticResource PhoneTextLargeStyle}"/>
                                    <TextBlock Text="{Binding Description}" TextWrapping="Wrap" Margin="12,-6,0,0" Style="{StaticResource PhoneTextSubtleStyle}"/>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>

                </Grid>
            </controls:PivotItem>

            <controls:PivotItem Name="AdsPivot_Name" Header="{Binding Path=Strings.OtherProducts, Source={StaticResource LocalizedStrings }}" >
                <Grid Height="520">
                    <!--<phone:WebBrowser HorizontalAlignment="Left" Name="webBrowser_History" VerticalAlignment="Top" Height="424" Width="454" Visibility="Collapsed" />-->
                    <ListBox x:Name="Ads_List" Margin="0,0,0,-3" ItemsSource="{Binding Ads}" SelectionChanged="Ads_List_SelectionChanged" SelectionMode="Single">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Margin="0,0,0,17">
                                    <Image Source="{Binding ImageUri}" Width="60" Height="60" Margin="60,0,0,0" HorizontalAlignment="Left" />
                                    <TextBlock Text="{Binding Name}" TextWrapping="NoWrap" Margin="150,-70,0,0" Width="300" Style="{StaticResource PhoneTextLargeStyle}"/>
                                    <TextBlock Text="{Binding Description}" TextWrapping="Wrap" Margin="150,-25,0,0" Width="300" Style="{StaticResource PhoneTextSubtleStyle}"/>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                    
                </Grid>

            </controls:PivotItem>

            <controls:PivotItem Name="ScoresPivot_Name" Header="{Binding Path=Strings.LocalScores, Source={StaticResource LocalizedStrings }}" >
                <Grid Height="520">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="38" />
                        <RowDefinition Height="432*" />

                    </Grid.RowDefinitions>
                    <Grid Height="40" HorizontalAlignment="Left" Name="grid1" VerticalAlignment="Top" Width="460" Grid.RowSpan="2">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="auto" />
                            <ColumnDefinition Width="auto" />
                            <ColumnDefinition Width="auto" />
                            <ColumnDefinition Width="auto" />
                        </Grid.ColumnDefinitions>
                        <TextBlock Height="36" HorizontalAlignment="Center" TextAlignment="Center" Text="{Binding Path=Strings.Rank, Source={StaticResource LocalizedStrings }}" VerticalAlignment="Top" Width="60" FontSize="26" />
                        <TextBlock Height="36" HorizontalAlignment="Center" TextAlignment="Center" Text="{Binding Path=Strings.Name, Source={StaticResource LocalizedStrings }}" VerticalAlignment="Top" Width="160" Grid.Column="1" FontSize="26" />
                        <TextBlock Height="36" HorizontalAlignment="Center" TextAlignment="Center" Text="{Binding Path=Strings.Level1, Source={StaticResource LocalizedStrings }}" VerticalAlignment="Top" Width="100" Grid.Column="2" FontSize="26" />
                        <TextBlock Height="36" HorizontalAlignment="Center" TextAlignment="Center" Text="{Binding Path=Strings.Score, Source={StaticResource LocalizedStrings }}" VerticalAlignment="Top" Width="125" Grid.Column="3" FontSize="26" />
                    </Grid>
                    <ListBox x:Name="Scores_List" Margin="0,0,-12,3" ItemsSource="{Binding Scores}" SelectionMode="Single" Grid.Row="1" Grid.RowSpan="2">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Margin="0,0,0,17">
                                    <Grid Height="30" HorizontalAlignment="Left" VerticalAlignment="Top" Width="460">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="auto" />
                                            <ColumnDefinition Width="auto" />
                                            <ColumnDefinition Width="auto" />
                                            <ColumnDefinition Width="auto" />
                                        </Grid.ColumnDefinitions>
                                        <TextBlock Height="30" HorizontalAlignment="Center" TextAlignment="Center" Text="{Binding Index}" VerticalAlignment="Top" Width="60" />
                                        <TextBlock Height="30" HorizontalAlignment="Center" TextAlignment="Center" Text="{Binding Name}" VerticalAlignment="Top" Width="160" Grid.Column="1" />
                                        <TextBlock Height="30" HorizontalAlignment="Center" TextAlignment="Center" Text="{Binding Level}" VerticalAlignment="Top" Width="100" Grid.Column="2" />
                                        <TextBlock Height="30" HorizontalAlignment="Center" TextAlignment="Center" Text="{Binding Score}" VerticalAlignment="Top" Width="125" Grid.Column="3" />
                                    </Grid>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>

            </Grid>

            </controls:PivotItem>

            <controls:PivotItem Name="GlobalScoresPivot_Name" Header="{Binding Path=Strings.GlobalRank, Source={StaticResource LocalizedStrings }}" >
                <Grid Height="520">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>                    
                    <phone:WebBrowser  Width="480" HorizontalAlignment="Center" Name="webBrowser1" VerticalAlignment="Top" Height="520" Margin="-12,0" />
                </Grid>

            </controls:PivotItem>

            
            <controls:PivotItem Name="InfoPivot_Name" Header="{Binding Path=Strings.Credits, Source={StaticResource LocalizedStrings }}" >
                <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0" Height="520">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="0*" />
                        <RowDefinition Height="232*" />

                        <RowDefinition Height="82*" />

                        <RowDefinition Height="144*" />
                        <RowDefinition Height="62*" />

                    </Grid.RowDefinitions>
                    <Image HorizontalAlignment="Stretch" Name="image1" Stretch="Uniform" VerticalAlignment="Stretch" Width="350" Source="/TapSequence;component/Images/vst_logo.png" Grid.Row="1" Margin="36,27,46,9" />
                    <TextBlock Grid.Row="2" TextAlignment="Center" FontSize="24" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="Developers_Area" Text="{Binding Path=Strings.Developer, Source={StaticResource LocalizedStrings }}" Margin="1,2,-1,46" />

                    <!--<Button Grid.Row="4" Name="Suggestion_Button" Content="{Binding Path=Strings.Suggestion_Text, Source={StaticResource LocalizedStrings }}" Click="Suggestion_Button_Click" />-->

                    <Button Grid.Row="3" Name="Suggestion_Button" Click="Suggestion_Button_Click" Margin="0,35,0,16" FontSize="16">
                        <Button.Content>
                            <TextBlock TextAlignment="Center" 
            Text="{Binding Path=Strings.Suggestion_Text, Source={StaticResource LocalizedStrings }}"
            TextWrapping="Wrap" Height="24" Width="369" FontSize="16" />
                        </Button.Content>
                    </Button>



                    <TextBlock Grid.Row="4" TextAlignment="Center" FontSize="24" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="Version_Area" Text="{Binding Path=Strings.Version, Source={StaticResource LocalizedStrings }}"  TextWrapping="Wrap" />
                    <TextBlock Grid.Row="2" TextAlignment="Center" Height="39" HorizontalAlignment="Center" Margin="0,40,-1,0" Name="textBlock1" Text="Luca Cosmo" VerticalAlignment="Top" Width="433" FontSize="22" />
                    <TextBlock Grid.Row="2" TextAlignment="Center" Height="36" HorizontalAlignment="Left" Margin="1,69,0,0" Name="textBlock2" Text="Francesco Boscariol" VerticalAlignment="Top" Width="429" Grid.RowSpan="2" FontSize="22" />
                </Grid>

            </controls:PivotItem>


        </controls:Pivot>
        
        <Rectangle Name="rectangle1" Width="480"  Height="80" Fill="White"  VerticalAlignment="Top"  HorizontalAlignment="Center" Margin="0"  Grid.Row="1"/>
        <mmi:MMAdView x:Name="mmAdView1"  Background="Transparent" Height="60" Width="480" HorizontalAlignment="Center"  VerticalAlignment="Top" Apid="43442" RefreshTimer="60" AdType="MMBannerAdBottom" Grid.Row="1" Margin="0,10,0,0" />

        <my:AdControl Height="80" Width="480" HorizontalAlignment="Center" Margin="0" Name="adControl1" VerticalAlignment="Top"  Grid.Row="1" ApplicationId="a8bcb4b7-95e4-47a7-8fc3-8514d98614c8" AdUnitId="56768" AdModel="Contextual" />
    
    </Grid>


</phone:PhoneApplicationPage>